package server.io.game.fact.player;

import server.io.game.conf.StaticArea;
import server.io.game.fact.Fact_Base;
import server.io.game.fact.card.Card_Base;
import server.io.game.fact.card.Card_Can;
import server.io.game.fact.hero.Hero_Base;
import server.io.game.fact.hero.Hero_Can;
import server.io.game.fact.user.User_Base;
import server.io.game.fact.user.User_Normal;

public abstract class Player_Base extends Fact_Base implements Player_Inter
{
	// 玩家位置顺序
	public int number;

	public User_Base user;
	// 手牌
	public Card_Can card_hand;
	// 装备牌
	public Card_Can card_equid;
	//
	public Hero_Can heros;
	//
	public Hero_Base hero;
	// 可选武将数量
	public int hero_amount = 5;

	public Player_Base()
	{
		// TODO Auto-generated constructor stub
	}

	public Player_Base(int id, String fact_id, String fact_type)
	{
		super(id, fact_id, fact_type);
		// TODO Auto-generated constructor stub
	}

	public void setHero(Hero_Base ahero)
	{
		this.hero = ahero;
	}

	/**
	 * 分配武将
	 */
	public void setHeros(Hero_Can aHeros)
	{
		this.heros = aHeros;
	}

	/**
	 * 分配手派
	 * 
	 * @param aCard_Hand
	 */
	public void setHandCard(Card_Can aCard_Hand)
	{
		this.card_hand = aCard_Hand;
	}

	/**
	 * 分配武将
	 * @return
	 */
	public int allotHero()
	{
		this.heros = new Hero_Can(10611, 5);
		// _heros.datas = StaticArea.can_heros.fillRandom(_heros.datas);
		this.heros.setAll(StaticArea.can_heros.getAll());
		return 0;
	}
	
	public void allotHandCard()
	{
		this.card_hand = new Card_Can(1116, 4);
		this.card_hand.setOne(new Card_Base(id, "sha_0001", "杀", "diamond",
				"media/images/fact/card/slash.png"));
		this.card_hand.setOne(new Card_Base(id, "lebusishu_0001", "乐不思蜀", "club",
				"media/images/fact/card/indulgence.png"));
		this.card_hand.setOne(new Card_Base(id, "wuzhongshengyou_0001", "无中生有", "heart",
				"media/images/fact/card/ex_nihilo.png"));
		this.card_hand.setOne(new Card_Base(id, "shan_0001", "闪", "diamond",
				"media/images/fact/card/jink.png"));
	}

	/**
	 * 选定武将
	 * 
	 * @param fact_id
	 */
	public void chooseHero(String fact_id)
	{
		this.hero = this.heros.findByFactId(fact_id);
	}

	@Override
	public void init()
	{
		// TODO Auto-generated method stub

	}

}
